{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>编辑</h5>
                </div>
                <div class="ibox-content layui-form">
                    <div class="layui-row layui-col-space10 layui-form-item ">
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">仓库编码：</label>
                            <div class="layui-input-block">
                                <input type="text" name="ck_code" value="{$data.ck_code}" lay-verify="required" placeholder="仓库编码" class="layui-input ">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">仓库名称：</label>
                            <div class="layui-input-block">
                                <input type="text" name="ck_remark" lay-verify="required" value="{$data.ck_remark}" placeholder="仓库名称" class="layui-input ">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">收件人：</label>
                            <div class="layui-input-block">
                                <input type="text" name="ck_name" value="{$data.ck_name}" lay-verify="required" placeholder="收件人" class="layui-input ">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">联系电话：</label>
                            <div class="layui-input-block">
                                <input type="text" name="ck_phone" value="{$data.ck_phone}" lay-verify="required" placeholder="联系电话" class="layui-input ">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">收件地址：</label>
                            <div class="layui-input-block">
                                <input type="text" name="ck_address" value="{$data.ck_address}" lay-verify="required" placeholder="收件地址" class="layui-input ">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">类型：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="ck_type" value="0" title="标准仓库" {if $data.ck_type == 0}checked{/if}>
                                <input type="radio" name="ck_type" value="1" title="自营默认" {if $data.ck_type == 1}checked{/if}>
                                <input type="radio" name="ck_type" value="2" title="增补默认" {if $data.ck_type == 2}checked{/if}>
                                <input type="radio" name="ck_type" value="3" title="统购默认" {if $data.ck_type == 3}checked{/if}>
                            </div>
                        </div>
                        <input type="hidden" name="ck_id" value="{$ck_id}">
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit="" lay-filter="component-form-element">保存
                                </button>
                                <button class="layui-btn layui-btn-primary" onclick="wk.layer_close('close')">关闭</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    layui.use(['form','upload','layedit','laydate'], function() {
        var form = layui.form;
        form.on('submit(component-form-element)', function (data) {
            $('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
            $.ajax({
                url:"{:url('update')}",
                type:'post',
                dataType:'json',
                data:data.field,
                success:function(res){
                    if (res.code == 200) {
                        layer.msg(res.msg,{icon:1,time:1500,shade:0.1},function(index){
                            wk.layer_close();
                        })
                    } else {
                        $("button").removeClass('layui-disabled').removeAttr('disabled');
                        wk.error(res.msg);
                        return false;
                    }
                }
            })
        });
    });
</script>

</body>
</html>
